package ar.com.mindset.geometrics_wi.colorScheme;


/**
 * @author http://www.mindset-designs.com
 */
public abstract class ColorScheme implements Writable {

    private String noRegionFillColor;
    private float noRegionFillAlpha = -1;


    public void setNoRegionFillColor(String noRegionFillColor) {
        this.noRegionFillColor = noRegionFillColor;
    }

    public void setNoRegionFillAlpha(float noRegionFillAlpha) {
        this.noRegionFillAlpha = noRegionFillAlpha;
    }

    public void setXMLColorSchemeTag(StringBuffer xml) {
        xml.append("<colorScheme");
        if (noRegionFillColor != null) {
            xml.append(" noRegionFillColor='").append(this.noRegionFillColor).append("'");
        }
        if (noRegionFillAlpha != -1) {
            xml.append(" noRegionFillAlpha='").append(this.noRegionFillAlpha).append("'");
        }
        xml.append(">");
    }

    public void setXMLColorSchemeEndTag(StringBuffer xml) {
        xml.append("</colorScheme>");

    }

    public void write(StringBuffer xml) {
        this.setXMLColorSchemeTag(xml);
        this.writeColorScheme(xml);
        this.setXMLColorSchemeEndTag(xml);
    }

    protected abstract void writeColorScheme(StringBuffer xml);
}
